GINO Graphics Suite - GINO v9.0  

Diagnostic Facilities

Output of Error and Warning Messages

GINO generates errors and warnings when it detects that something is wrong. A fault is classed as an error if GINO is unable to perform some task or has to take drastic action to remedy the situation, e.g. GINO error 1 - an attempt to output something when no device is nominated, so GINO nominates DUMMY as the default device-driver.

Warnings are displayed after less serious faults. GINO is able to carry on by assuming a straightforward default and the warning is generated simply to inform the user that this has happened, e.g.

GINO warning 46 - Negative colour index
Detected in call to gSetLineColour (LINCOL)


is generated when the colour index is set less than zero in a call to gSetLineColour(), so GINO uses the absolute value. The message will specify the GINO library within which the error was detected, the error/warning number, some text to describe the fault, and an indication of the GINO routine that detected the fault. The routine name listed is the F90 long name with the F77 short name in brackets. A complete list of GINO error and warning messages is given in Appendix E (see Errors and Warnings).

While error and warning messages are useful to indicate a possible problem in an application, there may be reasons to switch off warnings and/or error messages throughout, or at a particular place within an application. This can be achieved through the following routine:

gSetErrorMode(switch)

where its argument sets the desired output state of either GON (the default) or GOFF.

Error Limit

GINO keeps a count of errors and keeps a log of errors and warnings. When this count exceeds a specified limit, GINO stops the program. The limit is set to 10 and the count is set to zero when GINO is initialized. A call to the following routine allows the user to change the limit:

gSetMaxErrorLimit(n)

The limit can be disabled by setting n to -1. The count is reset to zero each time gSetMaxErrorLimit() is called.

Trapping of Errors and Warnings

There is a straightforward way to trap the occurrence of any errors or warnings. A call to gSetErrorTrap() enables or disables the trapping mechanism:

gSetErrorTrap(switch)

gEnqNumberOfErrors() may then be called to return the number of errors and warnings counted since enabling error trapping:

gEnqNumberOfErrors(n)

gEnqNumberOfErrors() returns n = -1, if trapping is disabled. More information about the errors and warnings that were trapped can be obtained by calling gEnqLastErrors() (see below).

Enquiry of Errors and Warnings

GINO can store up to 12 error and warning numbers. If more than 12 have been generated, GINO discards the oldest numbers. A call to gEnqLastErrors() will return up to n numbers along with the total count of errors only:

gEnqLastErrors(list, n, count)

The numbers are returned in integer array list, with the first element containing the most recent one. Error numbers are positive and warning numbers are negative. Any element of list that does not return a valid number is set to zero.

Error numbers from GINOGRAF, GINOSURF, GINOMENU and CGM are offset, to distinguish them from GINO errors as follows:

GINOGRAF      500
GINOSURF      1000
GINOMENU      1600
CGM           2000


So, for examle, GINOSURF Error 108 will be returned as 1108.

Routine Trace Facility

The routine trace facility outputs a message to identify each call made to a GINO routine. It is switched on by calling the routine:

gSetTracerMode(switch)

with a non-zero argument. The argument allows different trace reporting, listing the routine names of GINO and GINO's application packages . The routine trace facility is very useful for determining the exact sequence of calls to GINO routines, or to any routines in the GINO application packages.

Output Destination

By default, error messages are sent to a new error window if running under Windows or to the command window that initiated the program, in the case of running under Linux, UNIX or OpenVMS.

Users can direct error and tracer messages to an external file using the routine:

gSetErrorFilename(filename)

where filename is the name of a new external disk file where error and tracer messages are to be written.

or the old routine gSetErrorFile can be used:

gSetErrorFile(file)

where file is a unit number or pointer to a file previously opened through a call to the gFopen() function.

Alternatively, error output can be controlled through the configuration variable NFERTR set in the configuration file GINO.CON as follows:

NFERTR  
= 0 Visible (Default)
= 1 Iconized
= 2 Hidden
> 2 Errors are sent to a file called "application".err
  (e.g. myprog.err)

whereby the initial state of the default error window can be altered or errors can be redirected to a default filename.